function [vis_opts]=plot_opt(col_info,curr_fig,ydim,vis_opts)
%
% Function that takes column info data and creates the 
% visibility plot options for each site
%
% Input:
%   col_info = uicontrol pointers to column info
%   curr_fig = pointer to current figure
%   ydim = y dimension of window
%   vis_opts = uicontrol pointers to visibility plot options
% Output:
%   vis_opts = uicontrol pointers to visibility plot options

if exist('vis_opts'),
  for i=1:size(vis_opts,1),
    for j=1:size(vis_opts,2),
      set(vis_opts(i,j),'visible','off');
    end;
  end;
  clear vis_opts
end;

[sta_name,location,mask_info] = get_sta(col_info);

for j=1:size(sta_name,1),  % For each station
  if j==1,
    add_lines = 0;
  else,
    add_lines=add_lines+length(find(mask_info(:,1)==j-1))-1;
  end;
  vis_opts(j,1) = uicontrol(curr_fig, ...
    'BackgroundColor',[1 1 1], ...
    'HorizontalAlignment','center', ...
    'Position',[504 ydim-81-(j-1+add_lines)*16 20 12], ...
    'Value',1,...
    'Style','check');

  vis_opts(j,2) = uicontrol(curr_fig, ...
    'BackgroundColor',[1 1 1], ...
    'HorizontalAlignment','center', ...
    'Position',[532 ydim-81-(j-1+add_lines)*16 20 12], ...
    'Value',1,...
    'Style','check');

  vis_opts(j,3) = uicontrol(curr_fig, ...
    'BackgroundColor',[1 1 1], ...
    'HorizontalAlignment','center', ...
    'Position',[560 ydim-81-(j-1+add_lines)*16 20 12], ...
    'Value',1,...
    'Style','check');

  vis_opts(j,4) = uicontrol(curr_fig, ...
    'BackgroundColor',[1 1 1], ...
    'HorizontalAlignment','center', ...
    'Position',[588 ydim-81-(j-1+add_lines)*16 20 12], ...
    'Value',1,...
    'Style','check');

  vis_opts(j,5) = uicontrol(curr_fig, ...
    'BackgroundColor',[1 1 1], ...
    'HorizontalAlignment','center', ...
    'Position',[632 ydim-81-(j-1+add_lines)*16 20 12], ...
    'Value',1,...
    'Style','check');


  vis_opts(j,6) = uicontrol(curr_fig, ...
    'BackgroundColor',[1 1 1], ...
    'HorizontalAlignment','center', ...
    'Position',[664 ydim-81-(j-1+add_lines)*16 20 12], ...
    'Value',1,...
    'Style','check');

  vis_opts(j,7) = uicontrol(curr_fig, ...
    'BackgroundColor',[1 1 1], ...
    'HorizontalAlignment','center', ...
    'Position',[696 ydim-81-(j-1+add_lines)*16 20 12], ...
    'Value',1,...
    'Style','check');

  vis_opts(j,8) = uicontrol(curr_fig, ...
    'BackgroundColor',[1 1 1], ...
    'HorizontalAlignment','center', ...
    'Position',[728 ydim-81-(j-1+add_lines)*16 20 12], ...
    'Value',1,...
    'Style','check');

  vis_opts(j,9) = uicontrol(curr_fig, ...
    'BackgroundColor',[1 1 1], ...
    'HorizontalAlignment','center', ...
    'Position',[760 ydim-81-(j-1+add_lines)*16 20 12], ...
    'Value',1,...
    'Style','check');

  vis_opts(j,10) = uicontrol(curr_fig, ...
    'BackgroundColor',[1 1 1], ...
    'HorizontalAlignment','center', ...
    'Position',[788 ydim-81-(j-1+add_lines)*16 20 12], ...
    'Value',1,...
    'Style','check');

end;

% Check to see whether vis_opts was created
if ~exist('vis_opts'),
  vis_opts=[];
end;


